/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.baatar.opt.genetic.mutation;

import java.io.Serializable;
import java.util.Comparator;
import org.baatar.opt.genetic.chromosome.IChromosome;

/**
 * Interface for the mutation operators.
 * 
 * @author Ba
 */
public interface IMutator<T> extends Serializable {
    /**
     * Performs mutation operation according to the algorithm in the 
     * implementing class.
     * 
     * @param chromosome to be mutated.
     * 
     * @param mutationRatio ratio of the mutation operation to be performed.
     * 
     */
    public void mutate(IChromosome<T> chromosome, double mutationRatio);

    /**
     * Runs greedy operation according to the applied algorithm to this 
     * IChromosome object.
     * 
     * @param chromosome to be mutated.
     * 
     * @param greedRatio rate for the greedy operator.
     * 
     * @param comparator Comparator implementation which helps to compare 
     * chromosomes.
     * 
     */
    public void mutateGreedy(IChromosome<T> chromosome,
                                double greedRatio,
                                Comparator<IChromosome<T>> comparator);
}
